{% extends "books/base.html" %}

{% block title %}
<title>author detail</title>
{% endblock %}

{% block body %}
<div id="page">
  <h2>Author Detail</h2>
  <a href="{% url 'book:books_all' %}">书册清单</a>
  <a href="{% url 'book:author_list' %}">作家清单</a>
  <ul>
    <li>{{ author.name }}</li>
    <li>{{ author.salutation }}</li>
    <li>{{ author.get_sex_display }}</li>
    <li>{{ author.email }}</li>
    <li>
      <a href="{{ author.headshot.url }}">
        <img src= "{{ author.headshot.thumb_url }}" />
      </a>
    </li>
    <ol>
      {% for book in books %}
      <li><a href="{% url 'book:book_detail' book.id %}">{{ book.title }}</a> published_date:{{ book.publication_date }}</li>
      {% endfor %}
    </ol>
  </ul>
  <a href="{% url 'book:author_update' author.id %}">Update</a>
</div>
{% endblock %}
